var detail_quoted = {
	init:function()
	{
		$.ToTopCtrl();
		
		var $price_view_box = $('#price-view-box');
		var $price_btns = $price_view_box.find('.view-price-btn');
		if($price_btns.length > 0){
			$price_btns.each(function(i, e) {
                $(this).bind('click',function(){
					detail_quoted.viewPrice($(this));
				});
            });
		}
		
	},
	viewPrice:function($self){
		var pid = '';
		var units = 0;
		
		pid = $self.data('id');
		units = $self.data('unit');
		var unitlist =  ['','元/m2','元/m2','元/个','元/个','元/m','元/m2']
		
		
		var htmlContent = '';
		//报价处理
		$.post("/cooperate/myQuoted.html",{'cmd':'getpriceinfo','pid':pid,'unit':units},function(data) {
			   if(data=='error'){
				   alert('操作失败');
			   }else{
				    htmlContent = data
				   	layer.open({
					  type: 1,
					  title: '报价详情',
					  closeBtn: 1,
					  area: ['500px', '300px'],
					  shadeClose: true,
					  content: htmlContent
					});
			   }
        });
		
		/*
		//弹窗
		var htmlContent = '';
		
		htmlContent += '<div class="price-popup-box" >';
		
		htmlContent += '<table cellspacing="1" cellpadding="0" border="0">';
		htmlContent += '<tbody>';
		htmlContent += '<tr>';
		htmlContent += '<td class="one">报价：</td>';
		htmlContent += '<td class="two oneh">100元/m2</td>';
		htmlContent += '</tr>';
		htmlContent += '<tr class="twot">';
		htmlContent += '<td class="one">附加说明：</td>';
		htmlContent += '<td class="two twoh">如有疑问请联系客服人员</td> ';
		htmlContent += '</tr>';
		htmlContent += '</tbody>';
		htmlContent += '</table>';
		
		
		htmlContent+= ' </div>';
	
		layer.open({
		  type: 1,
		  title: '报价详情',
		  closeBtn: 1,
		  area: ['500px', '300px'],
		  shadeClose: true,
		  content: htmlContent
		});
		*/
		
		
	}
}


$(function(){
    detail_quoted.init();
});